home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June (Extra) / CHIP 2006-06.3.iso / program / opensource / clamav-devel.exe / contrib / init / RedHat / clamav-milter next >
Encoding:
Text File  |  2006-05-16  |  1.5 KB  |  77 lines

  1. #!/bin/sh
  2. #
  3. # clamav-milter This script starts and stops the clamav-milter daemon
  4. #
  5. # chkconfig: 2345 71 40
  6. #
  7. # description: clamav-milter is a daemon which hooks into sendmail and routes
  8. #              email messages to clamav
  9. # processname: clamav-milter
  10. # pidfile: /var/lock/subsys/clamav-milter
  11.  
  12. # Source function library.
  13. . /etc/rc.d/init.d/functions
  14.  
  15. # Source networking configuration.
  16. . /etc/sysconfig/network
  17.  
  18. # Local clamav-milter config
  19. CLAMAV_FLAGS=
  20. test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
  21.  
  22. # Check that networking is up.
  23. [ ${NETWORKING} = "no" ] && exit 0
  24.  
  25. [ -x /usr/local/sbin/clamav-milter ] || exit 0
  26. PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin
  27.  
  28. RETVAL=0
  29.  
  30. start() {
  31.         echo -n "Starting clamav-milter: "
  32.         LANG= daemon clamav-milter ${CLAMAV_FLAGS}
  33.         RETVAL=$?
  34.         echo
  35.     test $RETVAL -eq 0 && touch /var/lock/subsys/clamav-milter
  36.     return $RETVAL
  37. }
  38.  
  39. stop() {
  40.         echo -n "Shutting down clamav-milter: "
  41.         killproc clamav-milter
  42.         RETVAL=$?
  43.         echo
  44.     test $RETVAL -eq 0 && rm -f /var/lock/subsys/clamav-milter
  45. }
  46.  
  47. restart() {
  48.     stop
  49.     start
  50. }
  51.  
  52. # See how we were called.
  53. case "$1" in
  54.   start)
  55.         # Start daemon.
  56.     start
  57.         ;;
  58.   stop)
  59.         # Stop daemon.
  60.     stop
  61.         ;;
  62.   restart|reload)
  63.     restart
  64.         ;;
  65.   condrestart)
  66.     test -f /var/lock/subsys/clamav-milter && $0 restart || :
  67.         ;;
  68.   status)
  69.         status clamav-milter
  70.         ;;
  71.   *)
  72.         echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
  73.         exit 1
  74. esac
  75.  
  76. exit $?
  77.